package com.cms.service.dto;

import com.cms.core.foundation.BaseDto;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

/**
 * @author laolang
 * @version 1.0.0
 * @ClassName LogDto  日志信息跟数据库交互类
 */
@Data

public class LogDto  extends BaseDto<Integer> {

    private Integer userId;
    private String username;
    private String loginIp;
    private String url;
    private String content;

    public  static LogDto  of(Integer userId, String username, String loginIp, String url, String content){
        LogDto logDto = new LogDto();
        logDto.setContent(content);
        logDto.setUsername(username);
        logDto.setUserId(userId);
        logDto.setUrl(url);
        logDto.setLoginIp(loginIp);
        logDto.setCreateTime(LocalDateTime.now());
        return logDto;
    }

}
